package com.bawei.module_launcher

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import com.bawei.module_launcher.user.LoginActivity


class SplashActivity : AppCompatActivity() {
    private var handler = Handler()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.launcher_activity_splash)
        handler.postDelayed({
            finish()
            val intent = Intent(this, LoginActivity::class.java)
            startActivity(intent)
        },3000)

    }
    //避免内存泄漏
    override fun onDestroy() {
        super.onDestroy()
        handler.removeCallbacksAndMessages(null)
    }
}